package com.waitingresult.str;

public class OfferString05 {
    /**
     * 请实现一个函数，把字符串 s 中的每个空格替换成"%20"。
     */
//    public static void main(String[] args) {
//        System.out.println(replaceSpace("We are happy."));
//
//    }
    public static void main(String[] args) {
//        double result = 1341.25 - (100 - 1.18);
        System.out.printf("结果是: %.2f%n", test(1341.25, 100, 1.18));
        //结果是: 1240.07
        System.out.printf("结果是: %.2f%n", test2(1341.25, 100, 1.18));
        System.err.println((1709802144L - 8 * 60 * 60 + 30 *60)  * 1000);
    }

    public static double test(double t, double item1, double item2) {
        return t - item1 - item2;
    }

    public static double test2(double t, double item1, double item2) {
        return t - (item1 - item2);
    }

    public static String replaceSpace(String s) {

        return s.replaceAll(" ", "%20");
    }
}
